/*
 * Copyright (C), 2002-2017, 苏宁易购电子商务有限公司
 * FileName: Activity.java
 * Author:   15050536
 * Date:     2017年3月24日 下午6:12:03
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.member.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 会员外拓活动
 *
 * @author 15050536 石键平
 */
@Entity(name = "mem_activities")
public class Activity implements Serializable {

	/**
	 */
	private static final long serialVersionUID = 6652458725056173937L;

	private Long id;

	private String name;

	/**
	 * 活动考核开始时间
	 */
	private Date startTime;

	/**
	 * 活动考核结束时间
	 */
	private Date endTime;

	/**
	 * 大区编码
	 */
	private String areaCode;

	/**
	 * 分公司编码
	 */
	private String companyCode;
	/**
	 * 创建者角色,0:大区；1:分公司；2:店长
	 */
	private Short creatorRole;

	/**
	 * 0:刚创建;1:店长已分配;2:督导已分配
	 */
	private Short flow;

	/**
	 * 创建者姓名
	 */
	private String createUserName;

	/**
	 * 创建人工号
	 */
	private String createUser;

	private Date createTime;

	private String updateUser;

	private Date updateTime;

	public Activity() {

	}

	/**
	 * @param name
	 * @param startTime
	 * @param endTime
	 */
	public Activity(String name, Date startTime, Date endTime) {
		super();
		this.name = name;
		this.startTime = startTime;
		this.endTime = endTime;
	}

	@Id
	@Column(name = "id")
	//主键生成策略
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "start_time")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "end_time")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "area_code")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	@Column(name = "company_code")
	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	@Column(name = "creator_role")
	public Short getCreatorRole() {
		return creatorRole;
	}

	public void setCreatorRole(Short creatorRole) {
		this.creatorRole = creatorRole;
	}

	@Column(name = "flow")
	public Short getFlow() {
		return flow;
	}

	public void setFlow(Short flow) {
		this.flow = flow;
	}

	@Column(name = "create_user_name")
	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	@Column(name = "create_user")
	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_user")
	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	@Column(name = "update_time")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * 由于打印的时候包含包名，感觉太长了，使用ToStringStyle.SHORT_PREFIX_STYLE 截掉包名 
	 * 简单的toString()方法 都用的是简单的"+"，因为每"＋" 一个就会 new 一个 String 对象，
	 *	这样如果系统内存小的话会暴内存（前提系统实体比较多）
	 */
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}
}
